package com.polymorphic.detail;

import com.sun.org.apache.bcel.internal.generic.NEW;

/**
 * @Author 小闽
 * @Date 2024/8/12 16:20
 * @PackageName: com.polymorphic.detail
 * @ClassName: PolyDetail03
 * @Description: instanceof理解
 * @Version 1.0
 */
public class PolyDetail03 {
    public static void main(String[] args) {
        BB bb = new BB();
        System.out.println(bb instanceof BB);
        System.out.println(bb instanceof AA);

        AA aa = new BB();
        System.out.println(aa instanceof AA);
        System.out.println(aa instanceof BB);

        Object obj = new Object();
        System.out.println(obj instanceof AA);
        String str = "hello";
        System.out.println(str instanceof Object);
    }
}
